package db

import org.hibernate.Session

/**
 * manages operation with clients in front of the database.
 * enables to save, update and delete a client
 */
class ClientManager(session: Session) {
  if (session == null) {
    throw new RuntimeException("Invalid session object")
  }

  def saveClient(client: Client) {
    session.save(client)
  }

  def updateClient(client: Client) {
    session.update(client)
  }

  def deleteClient(client: Client) {
    session.delete(client)
  }

}